package edu.fim.data.dao;

import java.io.Serializable;
import java.sql.SQLException;
import java.util.List;

/**
 * The generic interface for Data Access Objects (DAOs). A DAO is responsible
 * for communicating with the database directly, and thus, encapsulates a way
 * to reach the database. In general, for every entity in the database,
 * there is a DAO.
 * 
 * @author Itikawa
 *
 * @param <T>: uma classe qualquer.
 */
public interface DAO<T, ID extends Serializable> {
	
	void insert(String baseStatement, T entity) throws SQLException;

	T findById(String baseStatement, ID id) throws SQLException;

	List<T> findAll(String baseStatement) throws SQLException;
	
	List<T> findByQuery(String baseQuery) throws SQLException;

	void update(String baseStatement, T entity) throws SQLException;

	void delete(String baseStatement, T entity) throws SQLException;
}